package com.itheima.job4;

import java.io.FileOutputStream;
import java.io.IOException;

public class Test {
    public static void main(String[] args) {
        //类型inputStream类型的数据
        byte[] buffer=new byte[3];
        System.out.println("请输入内容：");
        FileOutputStream fos=null;
        try {
             fos = new FileOutputStream("E:test/text.txt");
            int read ;
            while((read=System.in.read(buffer))!=-1) {
               fos.write(buffer,0,read);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                fos.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
